home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7713 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: ts1-017.jaxnet.com!user
  2. From: garyg@jax.jaxnet.com (Gary M. Greenberg)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Please Please Help! - pointer notation
  5. Date: Wed, 28 Feb 1996 07:26:58 -0500
  6. Organization: Southeast Network Services, Inc.
  7. Message-ID: <garyg-2802960726580001@ts1-017.jaxnet.com>
  8. References: <4gnlv9$1fh@news.mistral.co.uk>
  9. NNTP-Posting-Host: ts1-017.jaxnet.com
  10.  
  11. In article <4gnlv9$1fh@news.mistral.co.uk>, mikebarnard@mistral.co.uk
  12. (Mike Barnard) wrote:
  13.  
  14. >  Hi.
  15. >  
  16. >  I'm reposting this as I've had no replies and I'm still without the
  17. >  information.
  18. >  
  19. >  I've read my C book. I've gotten th C FAQ. I've read the file
  20. >  "ptrtutor.txt" a tutorial on pointers. But I havn't seen explained the
  21. >  following. Can you help?
  22. >  
  23. >  Sometimes when prototyping a function the function name is pre-fixed
  24. >  by an asterisk. Why? What does it mean? This is a quote from the
  25. >  pointer tutorial text by Ted Jensen...
  26.  
  27. In this instance, it means that the function has a return type of "char *" so
  28. that the function 'my_strcpy()' is a function returning a pointer to an
  29. array of characters.
  30.  
  31. Remember that:
  32.     "char * str;"
  33. is equivalent to:
  34.     "char* str;"
  35. which is equivalent to:
  36.     "char *str;"
  37.  
  38. Why should it be different because the object being defined is a function?
  39.  
  40. The last couple of issues of the C/C++ Users Journal has some decent articles
  41. explaining how to understand the syntax involved here and in much more complex
  42. cases.
  43.  
  44. [snip]
  45.  
  46. gary    /* the Sorcerer's Apprentice */
  47.  
  48. Free Speech in America murdered by the Communications Decency Act.
  49.                  U.S. Congress == Collective Moron
  50.     Hey, U.S. Government ->> "And the horse you rode in on!"
  51.